import { createRouter, createWebHistory } from "vue-router";

const routes = [
    {
        path: "/login",
        name: "Login",
        component: () => import('@/views/Login.vue')
    },
    {
        path: "/register",
        name: "Register",
        component: () => import('@/views/Register.vue')
    },
    {
        path: "/forget",
        name: "Forget",
        component: () => import('@/views/Forget.vue')
    },
    {
        path: "/",
        component: () => import("@/views/Layout/Layout.vue"),
        children: [
            {
                path: "",
                name: "Home",
                component: ()=> import("@/views/Layout/Home/Home.vue")
            },
            {
                path: "/articleList/:batchId",
                name: "ArticleList",
                component: ()=> import("@/views/Layout/ArticleManage/ArticleManage.vue")
            },
            {
                path: "batchManage",
                name: "BatchManage",
                component: ()=> import("@/views/Layout/BatchManage/BatchManage.vue")
            },
            {
                path: "/resultView/:batchId",
                name: "ResultView",
                component: ()=> import("@/views/Layout/ResultView/ResultView.vue")
            },
            {
                path: "/articleAdd/:batchId",
                name: "ArticleAdd",
                component: () => import("@/views/Layout/AddArtcle/AddArticle.vue")
            },
            {
                path: "userControl",
                name: "userControl",
                component: ()=>import("@/views/Layout/UserControl/UserControl.vue")
            }
        ]
    }
]

export default createRouter({
    history: createWebHistory(),
    routes
})